<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 打印5行5列星星
        // 核心：1、内层循环负责1行打印5颗星星 2、外层循环负责打印5行 3、用双重FOR循环做
        var str = "";
        for (var i = 1; i <= 5; i++) { //外层循环
            for (var j = 1; j <= 5; j++) { //内层循环
                str += "★"
            }
            // 如果一行打印完毕就要另起一行
            str += "\n"
        }
        console.log(str)
    </script>
</body>

</html>